<?php
header ( "Content-type: text/html; charset=utf-8" );
?>
<script type="text/javascript">
function showZyDetail(bizCode) {
	JYCsm.openWindow('?c=zy&a=detail&bizcode='+bizCode, {id:'zy-detail-dlg', title: '住院明细信息', width: 500});
}
</script>
<table class="qi_table" border="0" cellpadding="0" cellspacing="1">
	<tr>
		<th>患者姓名</th>
		<th>联系电话</th>
		<th>住院年龄</th>
		<th >性别</th>
		<th>入院时间</th>
		<th>出院时间</th>
		<th>科室</th>
		<th>医生</th>
		<th>回访状态</th>
		<th>回访结果</th>
		<th>操作</th>
	</tr>
                      <?php foreach ($rows as $row) {?>
                      <tr>
		<td><?php echo $row['TRUE_NAME']?></td>
		<td><?php echo $row['PHONE']?></td>
		<td><?php echo ATools::getZhuyuanAge($row['ZY_AGE'])?></td>
		<td><?php echo $row['SEX']?></td>
		<td><?php echo $row['RY_DATE']?></td>
		<td><?php echo $row['CY_DATE']?></td>
		<td><?php echo $row['CY_DEP']?></td>
		<td><?php echo $row['ZYDOC']?></td>
		<td><?php echo ATools::getVisitStatus($row['VISIT_STATE'])?></td>
		<td><?php echo ATools::getConfig('app.visitResult.'.$row['VISIT_RESULT'])?></td>
		<td>
			<a href="javascript:showZyDetail('<?php echo $row['BIZ_CODE']?>');">住院明细</a>
			<?php if (empty($row['VISIT_STATE']) or $row['VISIT_STATE'] == 'A') {?>
			<a href="javascript:saveZyVisit('<?php echo $row['BIZ_CODE']?>','<?php echo $row['CY_DEP_NO']?>','<?php echo $row['ZYDOC_NO']?>');">标记小结</a>
			<?php }?>
		</td>
	</tr>
                      <?php }?>
                      <tr>
		<td colspan="11"><?php echo $pager;?><div class="clear"></div></td>
	</tr>
</table>